import { stringify } from 'qs';
import {request} from '../utils/request';
import { getConfig } from '../../config';
const config = getConfig();

// 路线信息列表--------------------------------------------------------------------
export async function queryPathList(params) {
  return request('/maintain/maintainline/list', {
    method: 'POST',
    body: params,
  });
}


// 增加路线
export async function actionPathAdd(params) {
  return request('/maintain/maintainline/save', {
    method: 'POST',
    body: params,
  });
}

// 编辑路线
export async function actionPathEdit(params) {
  return request('/maintain/maintainline/update', {
    method: 'POST',
    body: params,
  });
}


// 路线信息批量导出
export async function actionPathExport(params) {
  return request(
    "04020004",
    {
      method: "POST",
      body: params
    },
    null,
    null,
    "download"
  );
}

// 路线信息批量删除
export async function actionPathDel(params) {
  return request('/maintain/maintainline/delete', {
    method: 'POST',
    body: params,
  });
}


// 路线养护点保存
export async function actionPathCuringAdd(params) {
  return request('/maintain/maintainline/insertLineDevs', {
    method: 'POST',
    body: params,
  });
}


// 路线详情
export async function queryPathnInfo(params) {
  if (config.isMock) {
    return request(`/maintain/maintainline/info`, {
      method: 'POST',
      body: params,
    });
  }else{
    return request(`/maintain/maintainline/info/${params.lineId}`, {
      method: 'POST',
    });
  }
}



// 线路相关设备信息
export async function queryPDevForPath(params) {
  return request('/maintain/maintainline/queryLineDevs', {
    method: 'POST',
    body: params,
  });
}





